import { createStore } from "vuex";

const store =createStore({
  state:{
    //TODO:
    //存employeeInfo
    employeeInfo:{
      employee_name:'',
      //char(36)
      staff_id:'',
      //离职、部门调动、升职、降级等情况
      employee_status:1,
      //所属部门
      employee_department:1,
      //员工的职务
      employee_position:1,
      employee_phone:'0000000000',
      user_name:'',
      password:''
    },

    projectInfo:{
      project_id:''
    },

    FolderInfo:{
      parent_id:'',
      folder_id:'',
    },

    Jx:{
      employee_id:'',
      employee_name:''
    }

    
  },

  mutations:{
    //储存员工信息
    update_employeeInfo(state,res){
      state.employeeInfo.employee_name=res.employee_name
      state.employeeInfo.staff_id=res.staff_id
      state.employeeInfo.employee_status=res.employee_status
      state.employeeInfo.employee_department=res.employee_department
      state.employeeInfo.employee_position=res.employee_position
      state.employeeInfo.employee_phone=res.employee_phone
      state.employeeInfo.user_name=res.user_name
      state.employeeInfo.password=res.password
    },

    //存储项目信息
    update_project_id(state,id){
      state.projectInfo.project_id=id
    },

    //存储文件夹信息
    update_parent_id(state,id){
      state.FolderInfo.parent_id=id
    },

    update_folder_id(state,id){
      state.FolderInfo.folder_id=id
    },

    update_jx(state,id){
      state.Jx.employee_id=id
    },

    update_jx2(state,name){
      state.Jx.employee_name=name
    }

    

  }
})

export default store